<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
	<% if 	(params[:controller] == "computers" and params[:action] == "show"
			) or (
			params[:controller] == 'events' and params[:action] == "index"
			) %>
		<noscript>
			<meta http-equiv="refresh" content="5" />
		</noscript>
	<% end %>

	<title>Bliss - <%=h yield(:title) %></title>
	
	<%= stylesheet_link_tag 'scaffold' %>
	<%= stylesheet_link_tag 'menu_style' %>
	<%= stylesheet_link_tag 'style' %>
	<%= stylesheet_link_tag 'events' %>
	<%= stylesheet_link_tag 'stats' %>

	<%= javascript_include_tag :defaults %>
	<%= javascript_include_tag "prototype" %>
	<%= javascript_include_tag "jquery-1.7.1" %>
	<%= javascript_include_tag "tablefilter" %>
	<%= javascript_include_tag "tablepage" %>
	<script type="text/javascript">
	//<![CDATA[
		jQuery.noConflict();
		setTimeout("new Effect.Fade('notice');", 4500)
	//]]>

  </script>
	
	<%= yield "page_header" %>
</head>
<body class="gradient">
	<div id="header">
		<div id="logo"></div>
		<div id="login" class="rounded">
		
			<% if current_user
				nom=current_user.email.split('@')
				 %>			
				<div id="connected"><%= image_tag("connected.png") %> Bienvenue, <%= nom[0] %></div>
				<div id="logout"><%= image_tag("logout.png") %> <%= link_to "déconnexion", logout_path %></div>
			<% else %>
				<%= image_tag("signup.png") %>
				<%= link_to "s'enregistrer", signup_path %>
				<br/>ou<br/>
				<%= image_tag("not_connected.png") %><%= link_to "connexion", login_path %>
	
			<% end %>		
		</div>
	</div>
<div id="menu">
	<ul>
	   <li><a href="/rooms" target="_self" title="supervison" class="<%=  controller.controller_name == "rooms"? "active" : ''%>"><span>supervison</span></a></li>
	   <li><a href="/events" target="_self" title="Incident" class="<%=  controller.controller_name == "events"? "active" : ''%>"><span>Incident</span></a></li>
	   <li><a href="/stats" target="_self" title="reporting" class="<%=  controller.controller_name == "stats"? "active" : ''%>"><span>Reporting</span></a></li>
	   <li><a href="/computers" target="_self" title="ordinateurs" class="<%=  controller.controller_name == "computers"? "active" : ''%>"><span>Ordinateurs</span></a></li>
	</ul>
</div>

	<div id="container" class="rounded">
		

					<%= periodically_call_remote(:update    => "incident",
							 :url       => { :controller =>"events",:action => "raise_incident" },
							 :complete => visual_effect(:appear, 'incident'), 
							 
							 :loaded=>visual_effect(:fade, 'incident', :duration => 5),
							 :frequency => 120
							 )%>         

		<% if flash[:error] %>
			<div id="notice" <% if flash[:error] %>class="error"<% end %>>
				<%= flash[:error] %>
				
			</div> 
		
		<% elsif flash[:notice] %>
			<div id="notice" <% if flash[:notice] %>class="success"<% end %>>
				<%= flash[:notice] %>
			</div> 
		

		<% elsif flash[:info] %>
			<div id="notice" <% if flash[:info] %>class="info"<% end %>>
				<%= flash[:info] %>
			</div> 
		<% elsif flash[:warning] %>
			<div id="notice" <% if flash[:warning] %>class="warning"<% end %>>
				<%= flash[:warning] %>
			</div> 
		<% else %>
		<div id="incident" class="warning" style="display: none">
				
			</div> 
		<%end%>
		<div id="message" style="background-color: #CC0000"></div>
		<div id="application_message" style="display: hidden"></div>

		
		
		<div id="content" >
			<%= yield %>
		</div>
	</div>
	
</body>
</html>
